use Socket;
use Net::Domain qw(hostname hostfqdn hostdomain);

my $host = hostfqdn();
print $host . "\n";

my $address = inet_ntoa(
    scalar gethostbyname( $host || 'localhost' )
    );

print $address . "\n";
      
